#include "headfile.h"
#include "init.h"

int address = 0;  // EEPROM地址
extern TFT_eSPI tft;
extern long int total_flow[8];

void all_init()
{
    EEPROM.begin(100);
    for(uint8_t i=0;i<8;i++)
    {
        total_flow[i] = EEPROM.readLong(address);
        address += sizeof(long);
    }
    address = 0;
    tft.init();
    tft.fillScreen(TFT_BLACK);
    pinMode(5, OUTPUT);
    pinMode(18, OUTPUT);
    pinMode(19, INPUT);
    pinMode(21, INPUT);
    pinMode(22, INPUT);
    digitalWrite(18, HIGH);
    Serial2.begin(115200);
    xTaskCreatePinnedToCore(task_receive, "one", 4096, NULL, 1, NULL, 0);  // 0优先级最低
    disableCore0WDT();
}